home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / tvdmx.exe / TVDMXREP.DOC < prev    next >
Text File  |  1992-07-16  |  4KB  |  117 lines

  1. Unit tvDMXREP      --tvDMX Data Reporting Objects
  2.  
  3. The procedures and objects in this unit will output a report from the data
  4. in a tvDMX view.
  5.  
  6.  
  7. The reporting objects:
  8.  
  9.   object TDmxReport
  10.       This is the base reporting object.  It has an abstract Print() method
  11.       and will not function as-is.  
  12.  
  13.   object TDmxReportFile
  14.       Overrides TDmxReport's Print() method to output to a file.
  15.  
  16.   object TDmxReportStream
  17.       Overrides TDmxReport's Print() method to output to a stream.
  18.  
  19.   object TDmxReportHexFile
  20.       Overrides TDmxReportFile's RecNumStr() method to return a hexadecimal
  21.       address.  This object is defined in unit tvDMXHEX.PAS.
  22.  
  23.  
  24. Each object is initialized by its Init() constructor, and executed by a
  25. Run() method.  The reports can be customized by overriding virtual methods.
  26.  
  27.  
  28. Where to override sections of the printed page:
  29.  
  30.         AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  31.         BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
  32.         CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
  33.         DDDDDDEEEEEE.................FFFFFF
  34.         DDDDDDEEEEEE.................FFFFFF
  35.         DDDDDDEEEEEE.................FFFFFF
  36.         DDDDDDEEEEEE.................FFFFFF
  37.         DDDDDDEEEEEE.................FFFFFF
  38.         DDDDDDEEEEEE.................FFFFFF
  39.         DDDDDDEEEEEE.................FFFFFF
  40.         DDDDDDEEEEEE.................FFFFFF
  41.         GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
  42.         HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
  43.  
  44.  
  45.  [.]--data records as formatted by the tvDMX view.
  46.  
  47.   A --processed by procedure SetupPage.
  48.       The default method does nothing.
  49.  
  50.   B --processed by procedure PrintLabels.
  51.       This method outputs the DMX field header labels.
  52.  
  53.   C --processed by procedure SetupDMX.
  54.       Processes a line to appear under the field header labels.
  55.  
  56.   D --processed by procedure SetupLine.
  57.       The default method does nothing.
  58.  
  59.   E --outputs a string returned from RecNumStr(CurrentRecord).
  60.       This string is used only if line numbers are enabled.
  61.  
  62.   F --processed by procedure EndLine.
  63.       This method outputs a line-feed.
  64.  
  65.   G --processed by procedure EndDMX.
  66.       Processes a line to appear under the field header labels.
  67.  
  68.   H --processed by procedure EndPage.
  69.       This method outputs a page-feed.
  70.  
  71.  
  72.  
  73.  
  74. Report objects could be instantiated and run by themselves, but procedure
  75. DmxReportBox() can be used to execute the process from within a message box:
  76.  
  77.  
  78.   procedure DmxReportBox (ATitle :TTitleStr; Msg :string; Report :PDmxReport);
  79.  
  80.   Syntax:   ATitle --window title;
  81.             Msg    --message string to be displayed during printing;
  82.             Report --report object, initialized and ready to run
  83.                      (this is disposed after the procedure is done).
  84.  
  85. Example:
  86.  
  87.   DmxReportBox ('Working', 'Processing report...'^M^M^C'to "FILE"',
  88.                 New (PDmxReportFile, Init (DMX, '|', TRUE, 50,78, 'FILE')));
  89.  
  90.          'Working' --window title;
  91.             DMX    --a tvDMX view;
  92.             '|'    --replacement delimiter for visible delimiters
  93.                      above #126  (uses given delimiters if #0 is used);
  94.             TRUE   --display record numbers;
  95.             50     --number of records per page;
  96.             78     --width of each page;
  97.             'FILE' --report filename.
  98.  
  99.  
  100.  
  101. How to print data in the current window:
  102.  
  103.   procedure PrintCurrentWindow;
  104.   var  DMX  : PDmxScroller;
  105.   begin
  106.     DMX := Message (DeskTop, evCommand, cmDMX_RollCall, @Self);
  107.     If (DMX <> nil) then
  108.       begin
  109.       DmxReportBox ('Printing', 'Processing report...'^M^M^C'to "PRN"',
  110.             New (PDmxReportFile, Init (DMX, '|', TRUE, 50,78, 'PRN')));
  111.       end;
  112.   end;
  113.  
  114.  
  115. This procedure is demonstrated in the SAMPLES.PAS program.
  116.  
  117.